<!--
 * @Author: wangming
 * @Date: 2022-03-09 10:27:43
 * @LastEditors: wangming
 * @LastEditTime: 2022-03-09 10:51:42
 * @FilePath: /hanma-application-designer-fed/src/pages/designUniversal/__components__/dynamicForm/rightModel/components/__comModule__/changeLang.vue
 * @Description: 
-->
<template>
  <GlobalizationConfigWord
    @setLangCode="setLangCode"
    :localism="i18n"
  ></GlobalizationConfigWord>
</template>

<script>
import GlobalizationConfigWord from "@/components/globalizationConfigWord.vue";
export default {
  components: { GlobalizationConfigWord },
  props: ["config", "langkey"],
  methods: {
    setLangCode(langcode) {
      if (!this.config.i18n) {
        this.$set(this.config, "i18n", {});
      }
      this.$set(this.config.i18n, this.langkey, langcode);
    },
  },
  computed: {
    i18n() {
      return this.config?.i18n?.[this.langkey];
    },
  },
};
</script>

<style scoped lang="scss">
</style>
